package org.com.behavioralPattern.mediatorPattern;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/27 15:03
 */
public class Person {
    String name;
    Sex sex;
    int age;
    int requestAge;
    MarriageAgency agency;

    public Person(String name, int age, Sex sex, int requestAge, MarriageAgency agency) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.requestAge = requestAge;
        this.agency = agency;
        agency.register(this);
    }

    public void findPartner() {
        agency.pair(this);
    }

    enum Sex {

        Male, Female;
    }

}
